﻿#ifndef _REC_READ_MP4_H_
#define _REC_READ_MP4_H_
#include "rec_read_base.h"

class CRecRead_mp4 :public CRecReadBase
{
public:
	CRecRead_mp4(int buf_size, int clientID, int channel);
	CRecRead_mp4();
	~CRecRead_mp4();

	virtual	int Open(const char* file_path, int64_t startTime = 0, int64_t endTime = 0, bool bClearBuf = false);

	void Close(bool bImmediate = false);
	virtual int SeekToTime(int64_t time, bool bClear = true);
	virtual int ReadFrame(unsigned char* buf, uint32_t bufLen);
protected:
	virtual int ReadFIFONormal();

	virtual int ReadFIFO2Forward();

	virtual int ReadFIFOForward();

	virtual int ReadFIFOReback();

	//由于存储在文件当中的音频是针对ASF文件编码的格式，但是在网络传输的需要使用RTP的方式
public:
	virtual bool IsOpen();
private:
	string  file;
};
#endif //_REC_READ_MP4_H_